# Contributor: Sean McAvoy <seanmcavoy@gmail.com>
# Maintainer: Sean McAvoy <seanmcavoy@gmail.com>
pkgname=libnbd
pkgver=1.10.5
pkgrel=0
pkgdesc="NBD client library in userspace"
url="https://github.com/libguestfs/libnbd"
arch="all"
license="LGPL-2.0-or-later"
makedepends="perl autoconf automake gnutls-dev linux-headers libtool python3-dev
	bash bash-completion"
checkdepends="qemu-img bash python3"
subpackages="$pkgname-dev $pkgname-doc $pkgname-bash-completion"
source="
	https://download.libguestfs.org/libnbd/1.10-stable/libnbd-$pkgver.tar.gz
	"

# secfixes:
#   1.10.5-r0:
#     - CVE-2021-20286

prepare() {
	default_prepare
	autoreconf -fi
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc
	make
}

check() {
	make check
}

package() {
	make DESTDIR=$pkgdir install
}

sha512sums="
036c13d29bc1490d44051db79dcce01c5f61d8b2108f8ffa28eb5f225c75a622f7e490e7a5a4dff4eba14b8ff2535ba1d4183cf8e4a5569d6201c72bfea4bb11  libnbd-1.10.5.tar.gz
"
